"""
健康检查API
提供服务健康状态检查
"""
from fastapi import APIRouter
from utils.api_response import ApiResponseHelper
from utils.logger import app_logger
from config.settings import settings
from datetime import datetime

router = APIRouter(prefix="/api/v1", tags=["健康检查"])


@router.get("/health")
async def health_check():
    """健康检查"""
    return ApiResponseHelper.success(
        data={
            "status": "healthy",
            "service": settings.app_name,
            "version": settings.app_version,
            "timestamp": datetime.now().strftime("%Y-%m-%d %H:%M:%S")
        },
        msg="服务正常"
    )


@router.get("/")
async def root():
    """根路径"""
    return {
        "service": settings.app_name,
        "version": settings.app_version,
        "message": "人脸识别API服务运行中",
        "docs": "/docs",
        "health": "/api/v1/health"
    }
